{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from geoscilabs.dcip.DCWidgetPlate_2D import plate_app\n",
    "from IPython.display import display\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Purpose \n",
    "\n",
    "For a direct current resistivity (DCR) survey, currents are injected into the earth, and flow. \n",
    "Depending upon the subsurface conductivity structures current flow in the earth will be distorted and charges will accumulate on interfaces between regions of different conductivites. These changes can be measurable at the sufurface electrodes. \n",
    "\n",
    "Here, we focus on a plate target embedded in a halfspace, and investigate what is happening in the earth when static currents are injected. Different from the sphere case, which is symmetric, \"coupling\" between the Tx, target (conductor or resistor), and Rx will be significanlty different with various scenarios and geometries. \n",
    "Using this app we can investigate what effect different targets and survey geometries have on the currents, electric fields, potentials, charges, and sensitivities."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Set up\n",
    "\n",
    "<img src=\"https://github.com/geoscixyz/geosci-labs/blob/master/images/em/DC_PlateApp_Setup.png?raw=true\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Questions\n",
    "\n",
    "- Is the potential difference measured by a dipole over a conductive (/resisitive) target higher or lower compared to the half-space reference?\n",
    "- how do the field lines bend in presence of a conductive (/resistive) target?\n",
    "- Compared to the positive and negative sources (A and B), how are oriented the positive and negative accumulated charges around a conductive (/resistive) target?\n",
    "- How would you describe the secondary fields pattern? Does it remind you of the response of an object fundamental to electromagnetics?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Plate app\n",
    "\n",
    "## Parameters:\n",
    "\n",
    " - **survey**: Type of survey\n",
    " - **A**: (+) Current electrode  location\n",
    " - **B**: (-) Current electrode  location\n",
    " - **M**: (+) Potential electrode  location\n",
    " - **N**: (-) Potential electrode  location\n",
    " - **dx**: width of plate\n",
    " - **dz**: height/thickness of plate\n",
    " - **xc**: x location of plate center\n",
    " - **zc**: z location of plate center\n",
    " - **$\\theta$**: rotation angle of plate from the horizontal\n",
    " - **$\\rho_1$**: Resistivity of the halfspace\n",
    " - **$\\rho_2$**: Resistivity of the plate\n",
    " - **Field**: Field to visualize\n",
    " - **Type**: which part of the field\n",
    " - **Scale**: Linear or Log Scale visualization"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "b7b98278f5c242258929d750783affd0",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "MyApp(children=(ToggleButtons(description='survey', options=('Dipole-Dipole', 'Dipole-Pole', 'Pole-Dipole', 'P…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "app = plate_app();\n",
    "display(app)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.6"
  },
  "widgets": {
   "state": {
    "c46b63f079c44885be1aaa6c6c883394": {
     "views": [
      {
       "cell_index": 5
      }
     ]
    }
   },
   "version": "1.2.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
